adTempus API
PreviousUpNext
IScheduler::GetObjectsWhere Method

Gets objects that match specified criteria.

C++
HRESULT GetObjectsWhere(IObjectRequestFilter * filter, long maxRecords, VARIANT_BOOL addToCache, long * recordCount, [out,retval] IADTObjects** objects);
C#
GetObjectsWhere(IObjectRequestFilter filter, long maxRecords, VARIANT_BOOL addToCache, ref long recordCount, [out,retval] IADTObjects* objects);
Visual Basic
Sub GetObjectsWhere(filter As IObjectRequestFilter, maxRecords As long, addToCache As VARIANT_BOOL, ByRef recordCount As long, objects As [out,retval] IADTObjects*)
Parameters 
Description 
[in] IObjectRequestFilter * filter 
The filter used to select objects. 
[in] long maxRecords 
The maximum number of objects to return. Set to 0 to return all matching objects. 
[in] VARIANT_BOOL addToCache 
If true, the objects are added to the session's cache. If false, they are not. 
[out] long * recordCount 
On return, contains the number of matching objects found (which may be more than the number of objects returned, if maxRecords is used). 
[out,retval] IADTObjects** objects 
On return, contains the matching objects. 

The IObjectRequestFilter interface provides a SQL selection statement that adTempus uses to retrieve objects from the database. To use this method you may use one of the provided selectors (JobHistoryFilter or LogFilter) or define your own selector class that implements IObjectRequestFilter

This method can provide better performance than GetObjectsForClass and GetObjectsOfClassWhere because it uses server-side filtering: only the objects you request are retrieved and transmitted to the client. However, it requires an understanding of SQL and of the adTempus database.

Many objects are not meant to be directly retrieved. If you attempt to retrieve one of these objects, the method will return an empty collection. This applies to most objects that are not descended from IADTIndependentObject. For example, a JobStep object cannot be directly retrieved; you must obtain it from the Steps collection of the Job that owns it. 

GetObjectsWhere returns all objects that meet the criteria, regardless of what permissions you do or do not have for those objects. Before attempting to use an object from the collection, use its CanPerform method to make sure you have the appropriate permission, or your operation will fail. 

For example, if you are building a user interface that lists jobs for the user to edit, you should check each job returned by the method and only list those for which the user as at least saView permission.

adTempus API Reference version 3.0.0.0, revised 10/30/2008